package io.renren.modules.oss.service;

import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * 上传文件到本地服务器
 * Created by LDC on 2018/11/12.
 */
public interface FileUpLoadSrv {


    public Map<String, String> write(HttpServletRequest request,
                                     String fileKey, String modelName, String uuid) throws Exception;

    /**
     *
     * @param MultipartFile cm_file	文档文件对象
     * @param String modelName	文件类型
     * @param String uuid id值，根据需要决定
     * @throws Exception
     * @return	文件路径
     */
    public Map<String, String> write(MultipartFile cm_file, String uuid) throws Exception;

    public String getSuffix(String origFileName) throws Exception;

    /**
     *
     * @param request
     * @param response
     * @param uploadType
     * @param referId
     * @return
     * @throws Exception
     */
    public Map<String, Object> upload(HttpServletRequest request,
                                      HttpServletResponse response, String uploadType, String referId,
                                      String path) throws Exception;

    public void downLoadFile(HttpServletRequest request,
                             HttpServletResponse response, String filePath, String fileName)
            throws Exception;

}
